<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META NAME="Title" CONTENT="SMS Server Tools 3">
     <META NAME="Robots" CONTENT="INDEX,FOLLOW">
    <META NAME="Language" CONTENT="English">
    <title>SMS Server Tools 3</title>
<STYLE type="text/css">
BODY {
  BACKGROUND: #ffffff; MARGIN: 5px 5px 10px; FONT: 10pt verdana, geneva, lucida, arial, helvetica, sans-serif; COLOR: #000000
}
td {
  FONT: 10pt verdana, geneva, lucida, arial, helvetica, sans-serif;
}
h3 {
  background-color: #DCDCFE;
}
blockquote {
  background-color: #FFD;
  font-size: 90%;
  padding:5pt;
  padding-top:1pt;
  margin-bottom:5pt;
  border-style: outset;
  border-color: #aaaa99;
  border-width: 0.05pt 2pt 2pt 0.05pt;
}
blockquote p:first-letter {
  font-size: 110%;
  font-weight: bold;
  color: red;
}
</STYLE>
  </head>
  
<body>
<h2><font color=blue><a href="http://smstools3.kekekasvi.com">SMS Server Tools 3</a></font></h2>
<a href="index.html">Home</a>
<h3>Configuring Providers</h3>
<!-- START --><p>
Using [queues] and [providers] is optional. 
If you do not need it, leave both parts out. 
If you use it with smsd version below 3.1.7, you need to write both parts together into the config file and both parts need to have 
exactly the same number of lines with the same names.
With smsd version 3.1.7 or later, default value for the provider is "catch-all", which is the same as "0,1,2,3,4,5,6,7,8,9,s".
See also <a href="#example3">example 3</a> and <a href="#example4">example 4</a>.
</p>
<p>
Configuring providers enable a sort function in smsd. 
It takes a look at the destination phone numbers and sorts them into many queue directories - one 
queue for each phone network provider.
</p>
<p>
The individual queues allow you to assign modems specially to individual phone network providers, which 
can save a lot of money in some countries. 
</p>
<p>
You can configure up to 64 providers, 64 queues and 64 phone numbers for each provider. 
These limits are changeable.
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[queues]&nbsp;<br>
&nbsp;name = directory&nbsp;<br>
&nbsp;name = directory&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
&nbsp;[providers]&nbsp;<br>
&nbsp;name = number prefixes&nbsp;<br>
&nbsp;name = number prefixes&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
The name is only a short name for the queue directory. 
You would typically place the name of the phone network provider here. 
Spaces and control characters are not allowed here.
</p>
<p>
The number prefixes are the first digits of phone numbers that belong to the provider. 
This can be a single number or a comma separated list of many numbers. 
Write them in <u><b>international format</b></u> but without the first "+" character. 
</p>
<p>
<b>Example:</b>
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[queues]&nbsp;<br>
&nbsp;telecom = /var/spool/sms/telecom&nbsp;<br>
&nbsp;vodafone = /var/spool/sms/vodafone&nbsp;<br>
<br>
&nbsp;[providers]&nbsp;<br>
&nbsp;telecom = 49160, 49170, 49171, 49175, 49151&nbsp;<br>
&nbsp;vodafone = 491520, 49162, 49172, 49173, 49174, s&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
From the version >= 3.0 it is possible to define 's' for short numbers.
</p>

<p>
<b>Example 2:</b>
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[queues]&nbsp;<br>
&nbsp;finland = /var/spool/sms/finland&nbsp;<br>
&nbsp;other = /var/spool/sms/other&nbsp;<br>
<br>
&nbsp;[providers]&nbsp;<br>
&nbsp;finland = 358, s&nbsp;<br>
&nbsp;other = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
In this second example one queue is used to send messages to finnish destinations.
Also messages to short numbers are sent using this queue.
Another queue is used to send all other messages.
</p>
<p>
As defined in the <a href="configure.html">How to configure</a>, list of queues used should be defined for modems,
in this case:
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[GSM1]&nbsp;<br>
&nbsp;queues = finland&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
&nbsp;[GSM2]&nbsp;<br>
&nbsp;queues = other&nbsp;</b><br>
&nbsp;...&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
Automatic queue sorting can be overridden in the message file.
For example, header line <b>Queue: other</b> causes modem GSM2 to be used.
</p>

<p>
<b><a name="example3">Example 3:</a></b>
</p>
<p>
In some cases a modem should be selectable in the message file.
This kind of usage overrides a queue sorting, and if a modem is always selected, sorting is not required.
However, queue directories should still be defined, because they are used to store messages of each modem.
</p>
<p>
With smsd version 3.1.7 or later, the configuration could be:
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[queues]&nbsp;<br>
&nbsp;GSM1 = /var/spool/sms/GSM1&nbsp;<br>
&nbsp;GSM2 = /var/spool/sms/GSM2&nbsp;<br>
&nbsp;GSM3 = /var/spool/sms/GSM3&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
A section [providers] is left out, because all definitions can default to "catch-all".
</p>
<p>
Modem definitions in the configuration could be:
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[default]&nbsp;<br>
&nbsp;queues = modemname&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
&nbsp;[GSM1]&nbsp;<br>
&nbsp;...&nbsp;<br>
&nbsp;and so on...&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
A modem can be selected using the <b>Queue: &lt;modemname&gt;</b> header in the message file.
NOTE: if a queue is not selected, a message is sent using GSM1 because it's the first queue in the list.
</p>

<p>
<b><a name="example4">Example 4:</a></b>
</p>
<p>
In this example provider sorting is not used.
All modems will serve the MAIN queue.
First two modems will also serve the GROUP1 queue.
GSM1 will serve GROUP1 queue after MAIN queue is empty.
GSM2 will serve MAIN queue after GROUP1 queue is empty.
In addition, each modem has its own queue which is served first.
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[queues]&nbsp;<br>
&nbsp;MAIN = /var/spool/sms/queues/MAIN&nbsp;<br>
&nbsp;GROUP1 = /var/spool/sms/queues/GROUP1&nbsp;<br>
&nbsp;GSM1 = /var/spool/sms/queues/GSM1&nbsp;<br>
&nbsp;GSM2 = /var/spool/sms/queues/GSM2&nbsp;<br>
&nbsp;GSM3 = /var/spool/sms/queues/GSM3&nbsp;<br>
&nbsp;GSM4 = /var/spool/sms/queues/GSM4&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
A section [default] is handy when the setup has lot of modems with the same settings:
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[default]&nbsp;<br>
&nbsp;gueues = modemname, MAIN&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
Modems GSM1 and GSM2 need their own definition for queues:
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[GSM1]&nbsp;<br>
&nbsp;queues = modemname, MAIN, GROUP1&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
&nbsp;[GSM2]&nbsp;<br>
&nbsp;queues = modemname, GROUP1, MAIN&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
&nbsp;[GSM3]&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
&nbsp;[GSM4]&nbsp;<br>
&nbsp;...&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p>
<p>
Messages without the <b>Queue:</b> header are placed into the MAIN queue.
</p>
If it's needed that messages to short numbers and without Queue header are always sent using GSM4, this addition can be used:
</p>
<ol>
<li><p><b>Ghange</b> the order of <u>queue definitions: place GSM4 right after MAIN</u>, otherwise GROUP1 will be used to send messages to short numbers.
</p></li>
<li><p>
Define providers:
</p>
<p>
<table border=1 bgcolor=lightgrey><tr><TD>
<font face="Courier New, Courier, monospace">
<br>
&nbsp;[providers]&nbsp;<br>
&nbsp;MAIN = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9&nbsp;<br>
&nbsp;GSM4 = s&nbsp;<br>
<br>
</font>
</TD></tr></table>
</p></li>
</ol>

<hr>
</body>
</html>
